#include<stdio.h>
#include<string.h>

void rotate_str(char *str,int k)
{
  int len = strlen(str);
  while(k%len--)
  {
    char ch = str[0];
    char *p1 =str;
    char *p2 = str+1;
    while(*p2)
    {
      *p1 = *p2;
      p2++;
      p1++;
    }
    *p1 = ch;
  }
}

int main()
{
  char str[] = "ABCDEF";
  int k = 12;
  printf("%s\n",str);
  rotate_str(str,k);
  printf("%s\n",str);
  return 0;
}
